package com.osce.common.utils.oesc;

import cn.hutool.core.util.StrUtil;
import com.doudou.core.date.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

/**
 * @author zzxjs
 * @since 2023/9/7
 * 考试分配用户
 */
public class PlaceAllotBean {

    /**
     * 代号 如S1、X1
     */
    private String code;

    /**
     * 开始考试时间
     */
    private Date startTime;

    /**
     * 结束考试时间
     */
    private Date endTime;


    public PlaceAllotBean() {
    }

    public PlaceAllotBean(String code) {
        this.code = code;
    }

    public PlaceAllotBean(String code,Date startTime,Date endTime) {
        this.code = code;
        this.startTime = startTime;
        this.endTime = endTime;
    }

    public String getCode() {
        return code;
    }

    @JsonFormat(pattern = "HH:mm:ss")
    public PlaceAllotBean setCode(String code) {
        this.code = code;
        return this;
    }

    public Date getStartTime() {
        return startTime;
    }

    @JsonFormat(pattern = "HH:mm:ss")
    public PlaceAllotBean setStartTime(Date startTime) {
        this.startTime = startTime;
        return this;
    }

    public Date getEndTime() {
        return endTime;
    }

    public PlaceAllotBean setEndTime(Date endTime) {
        this.endTime = endTime;
        return this;
    }


    @Override
    public String toString() {
        return StrUtil.format("考生：{}，考试时间【{} ~ {}】",this.code, DateUtil.formatTime(this.startTime),DateUtil.formatTime(this.endTime));
    }
}
